import 'package:flutter/material.dart';
import 'package:hospitable_rental/pages/home/advisory/advisory_item.dart';
import 'package:hospitable_rental/widgets/common_image.dart';

class AdvisoryItemWidget extends StatelessWidget {
  final AdvisoryItem item;

  const AdvisoryItemWidget(
    this.item, {
    Key? key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 100.0,
      margin: EdgeInsets.only(left: 10.0, right: 10.0, bottom: 10.0),
      child: Row(
        children: [
          CommonImage(
            item.imageUri.toString(),
            width: 120.0,
            height: 90.0,
          ),
          SizedBox(width: 10.0),
          Expanded(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Text(
                  item.title.toString(),
                  style: TextStyle(color: Colors.black, fontWeight: FontWeight.w600),
                ),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Text(item.source.toString(), style: TextStyle(color: Colors.black54)),
                    Text(item.time.toString(), style: TextStyle(color: Colors.black54)),
                  ],
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
